<select id="J_province" name="province"></select>
<select id="J_city" name="city"></select>
<select id="J_district" name="district"></select>

<script type="text/javascript">
    var pid=<if condition="$province">{$province}<else />0</if>;  //选中的省份ID
    var cid=<if condition="$city">{$city}<else />0</if>;  //默认城市id
    var did=<if condition="$district">{$district}<else />0</if>;  //默认区县市id
    var temp_province=<if condition="$province">{$province}<else />0</if>;  //选中的省份ID
    var temp_city=<if condition="$city">{$city}<else />0</if>;  //默认城市id
    var temp_district=<if condition="$district">{$district}<else />0</if>;  //默认区县市id

    var getprovincejson,getCityJson,getDistrictJson;
    getprovincejson = {select:temp_province};
    getCityJson = {pid: pid, cid: cid,select:temp_city};
    getDistrictJson = {cid: cid, did: did,select:temp_district};

    $.post("{:U('Admin/ChinaCity/getProvince')}",getprovincejson,function(result){
        $("#J_province").html(result);
    });

    $.post("{:U('Admin/ChinaCity/getCity')}",getCityJson , function(result){
        $("#J_city").html(result);
    });

    $.post("{:U('Admin/ChinaCity/getDistrict')}", getDistrictJson, function(result){
        $("#J_district").html(result);
    });

    $('#J_province').change(function(){
        var pid_g=$(this).children('option:selected').val();

        $.post("{:U('Admin/ChinaCity/getCity')}", {pid: pid_g}, function(result){
            $("#J_city").show().html(result);
        });
        $("#J_district").html('<option value="">-州县-</option>');
    });

    $('#J_city').change(function(){
        var cid_g=$(this).children('option:selected').val();
        $.post("{:U('Admin/ChinaCity/getDistrict')}", {cid: cid_g}, function(result){
            $("#J_district").html(result);
        });
    });
</script>